1. Field
One aspect of the present invention relates to a relay device that relays transfer data which is transmitted and received between a plurality of apparatuses connected to each other.
2. Description of the Related Art
A network apparatus such as a switch or a router has a plurality of ports through which is connected to other network apparatuses. The network apparatus transfers data received through each of the ports to an appropriate port different from the port through which the data was received. The network apparatus transfers data in accordance with control information such as a header contained in relevant data. In such a manner, the data is transferred from one apparatus having relevant data to another apparatus. Hereinafter, control information is referred to simply as a “header”.
The network apparatus rebuilds the header in the data and transfers the data based on a result of searching a routing table. An example of header rebuilding will be described below with reference to FIG. 18. A network apparatus 100 shown in FIG. 18 has four ports 101-104. In the network apparatus 100, transfer data 105 containing a header a input through a port 101 is converted into transfer data 106 in which the header a is changed to a header b based on a first routing table (not shown).
As shown in FIG. 19A, for example, the header a contains “layer-2 transmission source network address (AAAAAAAA)”, “layer-2 destination network address (BBBBBBBB)”, “layer-3 transmission source network address (CCCCCCCC)”, and “layer-3 destination network address (DDDDDDDD)”. That is, the header a is made up of an address of layer 2 as a data link layer and an address of layer 3 as a network layer.
Then, as shown in FIG. 19B, the network apparatus 100 converts the header a into the header b, by converting “layer-2 transmission source network address (AAAAAAAA)” contained in the header a into information which indicates a port number (#1) of the input port 101 in the network apparatus 100, and “layer-2 destination network address (BBBBBBBB)” contained in the header a into information which indicates a port number (#3) of the output port 103 in the network apparatus 100. That is, to transfer data in the network apparatus 100, the contents of layer 2 are cleared, and then given information peculiar to the network apparatus 100, such as a port number, which is ascribed to the structure of the network apparatus 100.
Thus, the header a is converted into the header b in order to transfer data from the port 101 to the port 103 in the network apparatus 100. The header a is converted into the header b by converting a typical header format in a network into a format peculiar to the network apparatus 100.
Then, after transferring the transfer data 106 with the network apparatus 100, the transfer data 106 is converted into transfer data 107 in which the header b is changed to a header c based on a second routing table in the network apparatus 100.
As shown in FIGS. 19B and 19C, the network apparatus 100 converts the header b into the header c. The network apparatus 100 converts “intra-apparatus input port number (#1)”, that is, information indicating the input port 101, into “layer-2 transmission source network address (XXXXXXXX)” contained in the header b. The network apparatus 100 converts “intra-apparatus destination port number (#3)”, that is, information indicating the output port 103, into “layer-2 destination network address (YYYYYYYY)” contained in the header b.
In such a manner, the network apparatus 100 clears the header b of the contents peculiar to the network apparatus 100, that is, a transmission source port number and a destination port number, and instead adds the contents of layer 2, that is, a transmission source address and a destination address, to transmit the transfer data 107 from the port 103 in a typically prescribed format.
The header b is converted into the header c in order to convert a data format peculiar to the apparatus into a typically prescribed header format so that transfer data may be transmitted to the network via the port 103.
An example of the configuration of the network apparatus 100 to be tested is shown in FIG. 20. The network apparatus 100 includes a first conversion portion 110, a first check circuit 111, a second conversion portion 120, and a second check circuit 121. In FIG. 20, the ports 101-104 are not shown. Further, a tester 130 that tests the first check circuit 111 and the second check circuit 121 is connected to the network apparatus 100 shown in FIG. 20.
The first conversion portion 110 has a first routing table 112 in it, and converts the header a in the transfer data 105 into the header b based on the first routing table 112, as described above with reference to FIGS. 18 and 19.
The first routing table 112 retains the header a and header b in a condition where the contents of the headers are correlated with each other. The first routing table 112 is configured so that the contents of the header b may be searched by using the contents of the header a as a search key. Instead of retaining all the contents of the headers a and b as the contents of the header a, the first routing table 112 may retain “layer-2 transmission source network address (AAAAAAAA)” and “layer-2 destination network address (BBBBBBBB)” as the contents of the header a. The first routing table 112 may also retain “intra-apparatus input port number (#1)” and “intra-apparatus destination port number (#3)” in a condition where they are correlated with each other respectively.
The first conversion portion 110 searches the first routing table 112 by using the header a as a keyword and rebuilds the header a into the header b based on the contents of the header b obtained as a result of the search.
The first check circuit 111 is used to check search processing, in other words, conversion processing by the first conversion portion 110 and the validity of the contents of the header b.
The first check circuit 111 checks on whether search processing by the first conversion portion 110 is normally performed and whether results of the search are normal, based on the search results.
The first check circuit 111 discards relevant transfer data, in other words, abnormal data, if the search processing by the first conversion portion 110 is determined to have been performed abnormally as a result of the check. The first check circuit 111 also discards relevant transfer data if the search results are determined to be abnormal as shown in FIGS. 21A and 21B. On the other hand, transfer data on which the search results have been determined as being normal, that is, normal data, is transmitted to a subsequent stage by the first check circuit 111 ordinarily.
An example shown in FIG. 21A indicates a case where an abnormal data piece p and normal data pieces q, r, and s pass through the first check circuit 111 sequentially. In this case, the first check circuit discards only abnormal data p in the top and transfers the remaining normal data pieces q, r, and s as shown in FIG. 21B.
Abnormal data refers to data that should be discarded by the first check circuit 111 or the second check circuit 121 because its header contents are inappropriate.
On the other hand, normal data refers to data that should not be discarded by the first check circuit 111 or the second check circuit 121 because its header contents are appropriate.
The second conversion portion 120 has a second routing table 122. The second conversion portion 120 converts the header b in the transfer data 106 into the header c based on this second routing table 122, as described above with reference to FIGS. 18 and 19.
The second routing table 122 retains the headers b and c in a condition where their contents are correlated with each other. The second routing table 122 is configured so that the contents of the header c may be searched by using the contents of the header b as a search key. Instead of retaining all the contents of the headers b and c, the second routing table 122 may retain “intra-apparatus input port number (#1)” and “intra-apparatus destination port number (#3)” as the contents of the header b, and “layer-2 transmission source network address (XXXXXXXX)” and “layer-2 destination network address (YYYYYYYY)” as the contents of the header c in a condition where they are correlated with each other respectively.
The second conversion portion 120 searches the second routing table 122 by using the header b as a keyword. The second conversion portion 120 rebuilds the header b into the header c based on the contents of the header c obtained as a result of the search.
The second check circuit 121 is used to check search processing by the second conversion portion 120 and the validity of the contents of the header c.
That is, the second check circuit 121 checks on whether search processing by the second conversion portion 120 is normally performed and whether results of the search are normal, based on the search results.
The second check circuit 121 discards relevant transfer data like the first check circuit 111 if the search processing by the second conversion portion 120 is determined to have been abnormally performed as a result of the check. The second check circuit 121 also discards relevant transfer data if the search results are determined to be abnormal as shown in FIGS. 21A and 21B. On the other hand, transfer data on which the search processing by the second conversion portion 120 has been normally performed is transmitted to a subsequent stage by the second check circuit 121.
If any of the first check circuit 111 or the second check circuit 121 determines, as a result of checking, that the search processing or the transfer data is abnormal, the network apparatus 100 discards relevant transfer data to thereby prevent incorrect data from being propagated to an adjacent apparatus connected to it.
For example, if a search of the routing table by the first conversion portion 110 or the second conversion portion 120 is unsuccessful due to a fault in the network apparatus 100, the first check circuit 111 and second check circuit 121 use their check functions to thereby decide that data concerned is abnormal and discard the abnormal data.
Therefore, to realize stable operations of the network, conventionally, the tester 130 is equipped to test whether the first check circuit 111 and the second check circuit 121 are normal.
As shown in FIG. 20, for example, the tester 130 inputs the transfer data 105 containing the header a to the network apparatus 100 as test data. The tester 130 checks the first check circuit 111 and the second check circuit 121 based on the output transfer data 107 obtained by conversion in this network apparatus 100.
Japanese Patent Application Laid-Open No. 07-95236 discloses technologies that connect a packet exchange test apparatus to a device under test. The patent exchange test apparatus exchanges packets and exhaustively verifies a circuit which realizes a function to discard incorrect data based on header building rules in the device under test.